home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / DEV / I-Z / MEdit_1.5.cpt / Demo.mcr < prev    next >
Text File  |  1986-06-05  |  2KB  |  101 lines

  1. **************************************************************************
  2. * This macro file shows some of the new features of the macro language   *
  3. * You need MComp version 1.0D0 or later to compile this file.            *
  4. * Written           : 05.01.86 Matthias Aebi                             *
  5. * Last modification : 04.06.86 Matthias Aebi                             *
  6. **************************************************************************
  7.  
  8. *   1
  9. * the shortcuts should be in a second window just behind the text window
  10. "Glossary/G" {
  11.     Select(L.,C<|L.,C>);
  12.     Push;
  13.     Set($0,$S);
  14.  
  15.     Window(2);
  16.     Select(0,0);
  17.     Find($0);
  18.  
  19.     If NOT C: = 0 {
  20.         Select(L.,C:+1|L.,C$);
  21.         Copy;
  22.         Window(1);
  23.         Pop;
  24.         Paste;
  25.     }
  26.     Else {
  27.         Window(1);
  28.         Pop;
  29.         Select(L:,C:);
  30.     };
  31. };
  32.  
  33. *   2
  34. "Var test" {
  35.     Set(#0, 3);
  36.     Set(#3, -999);
  37.     Prompt("Is it -999 ?", #(#0));
  38. };
  39.  
  40. *   3
  41. "prev Word/1" {
  42.     Select(L.,C.-1);
  43.     Select(L.,C<);
  44.     Select(L.,C. | L.,C>);
  45. };
  46.  
  47. *   4
  48. "next Word/2" {
  49.     If  L$ > L. AND C: = C$ {
  50.         Select(L.+1, 0);
  51.     } Else {
  52.         Select(L:,C:+1);
  53.     };
  54.     Select(L.,C>);
  55.     Select(L.,C< | L.,C.);
  56. };
  57.  
  58. *   5
  59. "current Word/3" {
  60.     Select(L.,C< | L.,C>);
  61. };
  62.  
  63. *   6
  64. "CmpTest/A" {
  65.     prompt("String1",$1);
  66.     prompt("String2",$2);
  67.  
  68.     set(#0, strcmp($1, $2, 1));
  69.  
  70.     insert("\n");
  71.     insert($1);
  72.  
  73.     if #0 = 1 {
  74.         insert(" > ");
  75.     }
  76.     else { 
  77.         if #0 = 0 {
  78.             insert(" = ");
  79.         }
  80.         else  {
  81.             if #0 = -1 {
  82.                 insert(" < ");
  83.             }
  84.             else {
  85.                 insert(" ? ");
  86.             };
  87.         };
  88.     };
  89.  
  90.     insert($2);
  91. };
  92.  
  93. *   7
  94. "Window test/W" {
  95.     PROMPT("Window number", #0);
  96.     IF WINDOW(#0)
  97.         PROMPT("Window exists", $0)
  98.     ELSE
  99.         PROMPT("Window does not exist", $0);
  100. }.
  101.